Hi the proper running order of the sql files is
1. tableCreation
2. droppingpremadeforeignkeys
3.Tableinserts
4.alters
5.testingFile
6.JoinTest
7.Indexing
8.Rollback

might need to split up the alters table, i'm not 100% it had issues one day and fixed itself the next!